import { createStore ,applyMiddleware } from "redux";
import thunk from "redux-thunk";
import promise from 'redux-promise';
import logger from "redux-logger";
import reducer from "./Reducers";
import { persistStore, persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
const pConfig = {
  key: 'root',
  storage: storage,
};


// let store =  createStore(reducer,applyMiddleware(thunk,promise,logger));
// export default store;
const myPersistReducer = persistReducer(pConfig, reducer);
const store = createStore(myPersistReducer, applyMiddleware( promise, thunk));
export const persistor = persistStore(store);
export default store;